export const deviceTypeList = [
    {
        value: 'maker',
        label: '制水机'
    },
    {
        value: 'drinker',
        label: '供水机'
    },
]

export const deviceStatusList = [
    {
        value: 'online',
        label: '在线'
    },
    {
        value: 'offine',
        label: '离线'
    },
    {
        value: 'fault',
        label: '故障'
    },
    {
        value: 'none',
        label: '不存在'
    },
]

export const getDeviceTypeName = (device) =>{

    for(let i = 0;i < deviceTypeList.length; i++) {
        if(device.type === deviceTypeList[i].value){
            return deviceTypeList[i].label
        }
    }
    return '未知类型'
}

export const getDeviceStatusName = (device) =>{

    if(device.status === null){
        return '不存在'
    }

    for(let i = 0;i < deviceStatusList.length; i++) {
        if(device.status === deviceStatusList[i].value){
            return deviceStatusList[i].label
        }
    }
    return '未知类型'
}